package main

import "fmt"

func test() {
	s := make([]int, 0, 2)
	fmt.Println("初始:", len(s), cap(s))
	for i := range 10000 {
		s = append(s, i)
		fmt.Printf("第%d次追加: len=%d, cap=%d\n", i+1, len(s), cap(s))
	}
}

func test2() {
	m := make(map[int]int)
	for i := 0; i < 100000; i++ {
		m[i] = i
		fmt.Println("map size:", len(m))
	}

}
